local roomIds = redis.call("ZREVRANGE",KEYS[1],ARGV[1],ARGV[2])
local count = redis.call("ZCARD",KEYS[1])
local data = redis.call("HMGET",KEYS[2],unpack(roomIds))
local res = {}
local pvs = {}
local shopIds = {}
for i,v in ipairs(roomIds) do
    pvs[i] = redis.call("HGET",KEYS[3]..roomIds[i],"watchPv")
    shopIds[i] = redis.call("LRANGE",KEYS[4]..roomIds[i],0,-1)
end
res[1] = roomIds
res[2] = data
res[3] = pvs
res[4] = shopIds
res[5] = count
return cjson.encode(res)
